package com.skyz.base.dialog;

import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;

import com.skyz.base.R;

public class LoadingDialogFragment extends BaseDialogFragment {

    public static LoadingDialogFragment showDialogFragment(@NonNull FragmentManager manager, @Nullable String tag) {
        LoadingDialogFragment loadingDialogFragment = new LoadingDialogFragment();
        loadingDialogFragment.show(manager, tag);
        return loadingDialogFragment;
    }

    private LoadingDialogFragment() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_fragment_loading;
    }

    @Override
    protected void onLayoutInflated(View view) {
        setDialogCancelable(false);
    }

    @Override
    protected WindowManager.LayoutParams initLayoutParams(WindowManager.LayoutParams layoutParams) {
        layoutParams.gravity = Gravity.CENTER;
        layoutParams.width = WindowManager.LayoutParams.WRAP_CONTENT;
        layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
        return layoutParams;
    }

    @Override
    protected void initData(Bundle savedInstanceState) {

    }
}
